package com.hainatong.jcmvvmbase.login.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder;
import com.hainatong.jcmvvmbase.R;
import com.hainatong.jcmvvmbase.databinding.ItemSelectLanguageBinding;
import com.hainatong.jcmvvmbase.login.entity.LanguageSelectedModel;
import org.jetbrains.annotations.NotNull;


public class LanguageAdapter extends BaseQuickAdapter<LanguageSelectedModel, BaseDataBindingHolder<ItemSelectLanguageBinding>>
{

    public LanguageAdapter()
    {
        super(R.layout.item_select_language);
    }

    @Override
    protected void convert(@NotNull BaseDataBindingHolder<ItemSelectLanguageBinding> bindingHolder,
                           LanguageSelectedModel languageSelectedModel)
    {
        ItemSelectLanguageBinding binding = bindingHolder.getDataBinding();
        if (binding != null)
        {
            binding.setLanguagetype(languageSelectedModel);
            binding.executePendingBindings();
        }
    }
}
